﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="users.aspx.cs" Inherits="RastinArgham.CRM.Web.users" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   

    <h3 class="ui-widget-header">
            <asp:Literal ID="lbtitle" runat="server" Text="مدیریت کاربران" />
    </h3>
    
    <div class="ui-layout-content ui-widget-content">

        <asp:TextBox ID="txtSearch" lang="en" runat="server"></asp:TextBox>
         &nbsp; &nbsp;
        <asp:Button ID="btnSearch" runat="server" Text="جستجو" 
            onclick="btnSearch_Click" />

        <div class="space2"></div>
        
        <mani:PagingGridView runat="server" ID="gvUsers" 
            AutoGenerateColumns="false" GridLines="none" DataKeyNames="UserName" 
            onrowcreated="gvUsers_RowCreated" onrowdeleting="gvUsers_RowDeleting" 
            onselectedindexchanging="gvUsers_SelectedIndexChanging" AllowPaging="true" 
            PageSize="20" onpageindexchanging="gvUsers_PageIndexChanging">

            <Columns>
                <asp:BoundField HeaderText="نام کاربری" DataField="UserName" />
                <asp:BoundField HeaderText="نقش ها" DataField="RoleName" />
                <asp:BoundField HeaderText="آدرس ایمیل" DataField="Email" />
                <asp:BoundField HeaderText="تاریخ ایجاد" DataField="PersianCreateDate" />
                <asp:BoundField HeaderText="زمان آخرین فعالیت در سیستم" DataField="PersianLastActivityDate" />
                <asp:CheckBoxField HeaderText="غیر فعال" DataField="IsLockedOut" />

                <asp:TemplateField>
                    <itemtemplate>
                        <asp:LinkButton ID="btnEdit" runat="server" CausesValidation="False" CommandName="Select">
                                <img src="/App_Themes/<%=Page.Theme %>/images/edit.gif" alt="" style="border:0;" />
                        </asp:LinkButton>
                    </itemtemplate>
                </asp:TemplateField>

                <asp:TemplateField>
                    <itemtemplate>
                        <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete">
                                <img src="/App_Themes/<%=Page.Theme %>/images/delete.gif" alt="" style="border:0;" />
                        </asp:LinkButton>
                    </itemtemplate>
                </asp:TemplateField>
            </Columns>
        </mani:PagingGridView>


        <div class="space"></div>
        
        <h3>ایجاد و ویرایش کاربر:</h3>

        <table>
            <tr>
                <td>
                    نام کاربری
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtUserName"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvUserName" ControlToValidate="txtUserName" runat="server" ErrorMessage="*" ValidationGroup="AddEditUser" />
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>
                    آدرس ایمیل
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtUserEmail" Width="250"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvUserEmail" ControlToValidate="txtUserEmail" runat="server" ErrorMessage="*" ValidationGroup="AddEditUser" />
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>رمز عبور</td>
                <td>
                    <asp:TextBox runat="server" TextMode="Password" ID="txtPassword"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
   
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>لیست نقشها</td>
                <td>
                    <asp:CheckBoxList ValidationGroup="AddEditUser" DataTextField="RoleName" DataValueField="RoleName" ID="cbUserRoles" runat="server" />
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>کاربر مسئول</td>
                <td>
                    <asp:DropDownList ID="ddlAgents" runat="server" DataTextField="UserName" DataValueField="UserId" AppendDataBoundItems="true">
                        <asp:ListItem Text="---" Value="-1" />
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>لیست شهرها</td>
                <td>
                    <asp:ListBox ID="lbCities" runat="server" DataTextField="CityName" DataValueField="CityId" SelectionMode="Multiple" Style="text-align:right; font-family:Tahoma; font-size:small; font-weight:normal; direction:rtl;" Width="200">
                    </asp:ListBox>
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>
                    غیر فعال :
                </td>
                <td>
                    <asp:CheckBox ID="cbIsLockedOut" runat="server" />
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btnSave" runat="server" Text="ذخیره تغییرات" onclick="btnSave_Click" ValidationGroup="AddEditUser" />
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
